/**
 *
 * @author Robert Serrat
 */

package prop;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;

public class Baraja extends MontonCartas implements Serializable {

    public Baraja() {
        cartas = new ArrayList();
    }

    public Baraja(int numBarajas, int numComodines){
        cartas = new ArrayList();
        for (int i = 0; i < numBarajas; ++i) {
            for(int j = 1; j < 14; ++j) {
                cartas.add(new Carta(Carta.Palos.CORAZON,j));
            }
            for(int j = 1; j < 14; ++j) {
                cartas.add(new Carta(Carta.Palos.DIAMANTE,j));
            }
            for(int j = 1; j < 14; ++j) {
                cartas.add(new Carta(Carta.Palos.PICA,j));
            }
            for(int j = 1; j < 14; ++j) {
                cartas.add(new Carta(Carta.Palos.TREBOL,j));
            }
            for (int j = 0; j < numComodines; ++j) {
                cartas.add(new Carta(Carta.Palos.COMODIN,0));
            }
        }
    }

    public void barajar() {
        Collections.shuffle(cartas);
    }

}